﻿using System.Xml.Linq;

namespace StockAccessors.Interdin.Model
{
    internal class WebFuture : WebItem
    {
        #region Properties

        public string Expiry
        {
            get
            {
                return base.ExtractTableCellValue(1);
            }
        }

        public string LastValue
        {
            get
            {
                return base.ExtractTableCellValue(2);
            }
        }

        public string Difference
        {
            get
            {
                return base.ExtractTableCellValue(3);
            }
        }

        public string OpenInterest
        {
            get
            {
				if (base.IsBidAndAskVolumesAndValuesTogether)
				{
					return base.ExtractTableCellValue(10);
				}
				else if (base.IsBidVolumeAndValueTogether || base.IsAskVolumeAndValueTogether)
				{
					return base.ExtractTableCellValue(11);
				}
				else
				{
					return base.ExtractTableCellValue(12);
				}
            }
        }

        public string Hour
        {
            get
            {
				return base.ExtractTableCellValue(base.Lines.Count - 1);
            }
        }

        #endregion

        #region Public Methods

        public WebFuture(XElement data) : base(data)
        {
        }

        #endregion
    }
}
